package com.cqupt.sendMes.utils;


import lombok.Data;

import java.io.Serializable;
import java.util.List;
@Data
public class PageResult<E> implements Serializable {
    /***
     * 当前页
     */
    private Integer currentPage;
    /**
     * 总数据项数
     * */
    private Long totalItem;
    /**
     *每页大小
     *  */
    private Integer pageSize;
    /**
     * 数据
     * */
    private List<E> data;

    public static <T> PageResult<T> build(Integer currentPage, Long totalItem, Integer pageSize, List<T> data){
        PageResult<T> pageResult = new PageResult<>();
        pageResult.currentPage = currentPage;
        pageResult.totalItem = totalItem;
        pageResult.pageSize = pageSize;
        pageResult.data = data;
        return pageResult;
    }
}
